#include <stdio.h>

//一只猴子采了n个桃子，每天吃剩下桃子的一半多一个，到第十天还剩一个，问原先有多少桃子？
int EatPeach(int day)
{
    //终止条件
    if(day == 10)
    return 1;

    return  (EatPeach(day + 1)+1)*2;
}

//用递归实现a的阶乘
int Mult(int num)
{
    if(num == 1)
    return num;
    return num*Mult(num-1);
}

//计算字符串长度strlen 递归
int MyStrlen(char *s)
{
    if(*s == '\0')
    {
        return 0;
    }
    return MyStrlen(s+1)+1;
}

int main()
{
    //printf("%d\n",EatPeach(9));
    //printf("%d\n",Mult(6));
    char s[] = "hello";
    printf("%d\n",MyStrlen(s));
    return 0;
}